import request from '@/utils/request'
import qs from 'qs'



export function meta_sport_item(data) {
  return request({
    url: '/meta/sport_item/json/all/'+data,
    method: 'post',
  })
}

export function weekPlanOverView(data) {
  return request({
    url: '/plan/weekPlanOverView',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function allType(data) {
  return request({
    url: '/print/allType',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function weekPlan(data) {
  return request({
    url: '/plan/weekPlan',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function insertDocData(data) {
  return request({
    url: '/plan/plan_doc/insertDocData',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function planSave(data) {
  return request({
    url: '/plan/plan_doc_data/planSave',
    method: 'post',
    headers: {'Content-Type': 'application/json; charset=UTF-8'},
    data
  })
}

export function updateDocData(data) {
  return request({
    url: '/plan/plan_doc/updateDocData',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function getContent(data) {
  return request({
    url: '/plan/scanAndModify/getContent',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function classExercisePlan(data) {
  return request({
    url: '/plan/classExercisePlan',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function probeClassPlan(data) {
  return request({
    url: '/plan/scanAndModify/probeClassPlan',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function genDefault(data) {
  return request({
    url: '/plan/plan_doc/genDefault',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function data4import(data) {
  return request({
    url: '/newPlanDoc/data4import',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function docItemDefClassifyByDefId(data) {
  return request({
    url: '/plan_template/docItemDefClassifyByDefId',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function plan_template(data) {
  return request({
    url: '/plan_template/byClassifyId/'+data.docItemDefId+'/'+data.docItemDefClassifyId+ (data.sportId?('/'+data.sportId):''),
    method: 'post',
    data: qs.stringify(data)
  })
}

export function myTemplate(data) {
  return request({
    url: '/plan_template/myTemplate',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function plan_template_insert(data) {
  return request({
    url: '/plan_template/insert',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function plan_template_update(data) {
  return request({
    url: '/plan_template/update',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function plan_template_delete(data) {
  return request({
    url: '/plan_template/delete',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function definedTemplate(data) {
  return request({
    url: '/plan_template/definedTemplate',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function fullYearPlan(data) {
  return request({
    url: '/plan/fullYearPlan',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function periodPlan(data) {
  return request({
    url: '/plan/periodPlan',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function fullYearSummary(data) {
  return request({
    url: '/plan/fullYearSummary',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function winterPeriodPlan(data) {
  return request({
    url: '/plan/winterPeriodPlan',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function winterSummary(data) {
  return request({
    url: '/plan/winterSummary',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function pre_MatchPlan(data) {
  return request({
    url: '/plan/pre_MatchPlan',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function matchSummary(data) {
  return request({
    url: '/plan/matchSummary',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function yearMatchSummary(data) {
  return request({
    url: '/plan/yearMatchSummary',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function matchScheme(data) {
  return request({
    url: '/plan/matchScheme',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function multiYearPlan(data) {
  return request({
    url: '/plan/multiYearPlan',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function yearPaper(data) {
  return request({
    url: '/plan/yearPaper',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function defaultOption4newPeriodPlan(data) {
  return request({
    url: '/plan/plan_doc/defaultOption4newPeriodPlan',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function doc_excel_key(data) {
  return request({
    url: '/doc_excel/json/key',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function doc_excel_update(data) {
  return request({
    url: '/doc_excel/json/update',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function doc_excel_insert(data) {
  return request({
    url: '/doc_excel/json/insert',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function plan_doc_all(docClassId) {
  let url = '/plan/plan_doc/json/all'
  if(docClassId) {
    url = '/plan/plan_doc/json/all/'+docClassId
  }
  return request({
    url: url,
    method: 'post',
  })
}

export function plan_doc_delete(data) {
  return request({
    url: '/plan/plan_doc/delete',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function plan_doc_select(data) {
  let url = '/plan/plan_doc/json/select'
  if(data && data.docClassId) {
    url = '/plan/plan_doc/json/select/'+data.docClassId
  }
  return request({
    url: url,
    method: 'post',
    data: qs.stringify(data.data)
  })
}

export function batchPrint(data) {
  return request({
    url: '/print/batchPrint',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function doc_excel_all(data) {
  return request({
    url: '/doc_excel/json/all',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function doc_excel_select(data) {
  return request({
    url: '/doc_excel/json/select',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function doc_excel_delete(data) {
  return request({
    url: '/doc_excel/json/delete',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function moralityEducation(data) {
  return request({
    url: '/plan/plan_doc/moralityEducation',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function selectMoralityEducation(data) {
  return request({
    url: '/plan/plan_doc/selectMoralityEducation',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function morality(data) {
  return request({
    url: '/plan/morality',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function unitPlan(data) {
  return request({
    url: '/plan/unitPlan',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function unitSummary(data) {
  return request({
    url: '/plan/unitSummary',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function honorReword(data) {
  return request({
    url: '/plan/honorReword',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function science(data) {
  return request({
    url: '/plan/science',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function antiDoping(data) {
  return request({
    url: '/plan/antiDoping',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function eduWorking(data) {
  return request({
    url: '/plan/eduWorking',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function moralEducation(data) {
  return request({
    url: '/plan/moralEducation',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function echelonConstruction(data) {
  return request({
    url: '/plan/echelonConstruction',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function trainDepartmentMiddleLongPlan(data) {
  return request({
    url: '/plan/trainDepartmentMiddleLongPlan',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function trainPlanAndSummary(data) {
  return request({
    url: '/plan/trainPlanAndSummary',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function regulation(data) {
  return request({
    url: '/plan/regulation',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function all4regulationManagement(data) {
  return request({
    url: '/plan/plan_doc/json/all4regulationManagement',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function select4regulationDepartment(data) {
  return request({
    url: '/plan/plan_doc/json/select4regulationDepartment',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function plan_doc_management(data) {
  return request({
    url: '/plan/plan_doc/'+data.name,
    method: 'post',
    data: qs.stringify(data.data)
  })
}

export function regulation_fileUpload(data) {
  return request({
    url: '/regulation/fileUpload',
    method: 'post',
    data
  })
}

export function regulation_filePath4pdf(data) {
  return request({
    url: '/regulation/filePath4pdf',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function plan_statistics(data) {
  return request({
    url: '/plan/statistics',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function sportTeamYearPlanAndSummary(data) {
  return request({
    url: '/plan/sportTeamYearPlanAndSummary',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function doc_class_all(data) {
  return request({
    url: '/data/doc_class/json/all',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function doc_copyAll(data) {
  return request({
    url: '/plan/plan_doc/copyAll',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function doc_copyAllByDate(data) {
  return request({
    url: '/plan/plan_doc/copyAllByDate',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function fileDownload(data) {
  return request({
    url: '/regulation/fileDownload/'+data,
    method: 'post',
    responseType: 'blob',
  })
}

export async function plan_doc_blankCheck(data) {
  // return request({
  //   url: '/plan/plan_doc/blankCheck',
  //   method: 'post',
  //   data: qs.stringify(data),
  // })
  let res = await request({
    url: '/plan/plan_doc/blankCheck',
    method: 'post',
    data: qs.stringify(data),
  })
  return res
}
